package com.ylfstu.Homework;

import java.util.*;

@SuppressWarnings({"all"})
public class Homework03 {
    public static void main(String[] args) {
        Map m = new HashMap();
        m.put("jack", 650);
        m.put("tom", 1200);
        m.put("smith", 2900);
        m.put("jack", 2600);

        Set entrySet = m.entrySet();
        for (Object o : entrySet) {
            Map.Entry entry = (Map.Entry) o;
            entry.setValue((int)(entry.getValue()) + 100);
//            System.out.println(entry.getValue().getClass());
        }
        Iterator iterator = entrySet.iterator();
        while (iterator.hasNext()) {
            Object next = iterator.next();
            Map.Entry next1 = (Map.Entry) next;
            System.out.println(next1.getKey() + "-" + next1.getValue());
        }

        System.out.println("----遍历员工----");
        Set set = m.keySet();
        for (Object o : set) {
            System.out.println(o);
        }

        System.out.println("----遍历工资----");
        Collection values = m.values();
        for (Object o : values) {
            System.out.println(o);
        }


    }
}
